import requestWs from './request.ws'

export const ws = new requestWs()

// 登录 2.12.1
export const login = (params) => {
  return ws.call('session', 'login', params)
}

// 登出 2.12.2
export const logout = () => {
  return ws.call('session', 'logout')
}

// 检查密码
export const checkpasswd = (params) => {
  return ws.call('session', 'checkpasswd', params)
}

// CPU状态  2.2.1.1
export const cpu = (params) => {
  return ws.call('cpu', 'get', params)
}

// 内存状态 2.2.1.2
export const memory = (params) => {
  return ws.call('memory', 'get', params)
}

// 阵列运行时间 2.1.2
export const runtime = () => {
  return ws.call('runtime', 'get')
}

// 风扇状态 2.2.1.4
export const fan = (params) => {
  return ws.call('fan', 'get', params)
}

// 获取控制器
export const controller = () => {
  return ws.call('controller', 'get')
}

// 2.9.1.1获取系统时间
export const systemtoolGettime = () => {
  return ws.call('systemtool', 'gettime')
}

// 2.9.1.2 设置系统时间
export const systemtoolSettime = (params) => {
  return ws.call('systemtool', 'settime', params)
}

// 2.9.1.3 获取当前登录用户
export const systemtoolGetloginuser = () => {
  return ws.call('systemtool', 'getloginuser')
}
// 2.9.1.4 更改登录口令
export const systemtoolChangepassword = (params) => {
  return ws.call('systemtool', 'changepassword', params)
}
//  导出配置获取地址
export const systemtoolExportconfget = (params) => {
  return ws.call('systemtool', 'exportconfget', params)
}
//  2.9.1.5 导出配置
export const systemtoolExportconf = (params) => {
  return ws.call('systemtool', 'exportconf', params)
}
// 2.9.1.6导入配置
export const systemtoolImportconf = (params) => {
  return ws.call('systemtool', 'importconf', params)
}
// 导出磁盘信息获取地址
export const systemtoolExportdiskinfoget = (params) => {
    return ws.call('systemtool', 'exportdiskinfoget', params)
  }
// 2.9.1.7 导出磁盘信息
export const systemtoolExportdiskinfo = (params) => {
  return ws.call('systemtool', 'exportdiskinfo', params)
}
// 2.9.1.8 重启设备
export const systemtoolRestart = (params) => {
  return ws.call('systemtool', 'restart', params)
}
// 2.9.1.9 关闭设备
export const systemtoolShutdown = (params) => {
  return ws.call('systemtool', 'shutdown', params)
}

// 2.3.1.1 获取网口设置
export const getNet = (params) => {
  return ws.call('net', 'get', params)
}

// 2.3.1.2 设置网口设置
export const setNet = (params) => {
  return ws.call('net', 'set', params)
}

// 获取绑定的参数
export const netBoudGet = (params) => {
  return ws.call('net', 'bondget', params)
}

// 2.3.1.3 绑定
export const netBoud = (params) => {
  return ws.call('net', 'bond', params)
}

// 2.3.1.4 解绑
export const netUnbound = (params) => {
  return ws.call('net', 'nbound', params)
}
